<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <div id="dialog-message">
 			
 			    <div class="widget-box" style="margin:0 auto;">
					<div class="widget-header widget-header-flat">
						<b>个人基本信息</b>
					</div>
					<div class="widget-body" style="min-height:600x;"> 
						 <table class="table table-striped table-hover table-bordered">
					 	<tr>
					 		<td width="50%">
					 		用户名：<font id="userName"></font>
					 		 
					 		</td>
					 		<td width="50%">
					 		中文名：<font id="userShowName"></font>
					 	 
					 		
					 		</td>
					 	</tr>
					 	<tr>
					 		<td>
					 		英文名：<font id="userEngListName"></font>
					 		 
					 		</td>
					 		<td>
					 		年龄：<font id="age"></font>
					 	 
					 		</td>
					 	</tr>
					 	 
					 	 
					 	<tr>
					 		<td>	
					 		性别：<font id="sex"></font>				
							 
							</font>	
					 		</td>
					 		<td>
					 			电话：<font id="tell"></font>
					 		 
					 		</td>
					 	</tr>
					 	<tr>
					 		<td>
					 		邮箱：<font id="userEmail"></font>
					 		</td>
					 		<td>
					 			座右铭：<font id="note"></font> 
					 		</td>
					 	</tr> 
					 	<tr>
					 		
					 		<td> 	
					 		<span>头像：<font id="userImage"></font></span>
					 		</td> 
					 		<td style="display:none;">
  							 
					 		</td>
					 	</tr>
					 	  
					 </table>  
						
												  
					</div>
				</div>

 			<!-- 老师区域  -->	
				<div class="widget-box" style="margin:0 auto;">
					<div class="widget-header widget-header-flat">
						<b>历届老师信息</b>
					</div>
				<div class="widget-body" style="min-height:600ox;"> 
					 <table class="table table-striped table-hover table-bordered">
					  <thead>
							<tr id="sys_teacher_table_title">
								  <th  width="40">编号</th>
								  <th  width="60" fname="userShowName">显示名称</th>
								  <th  width="60" fname="userEngListName">英文名称</th>
								  <th  width="40" fname="age">年龄</th>
								  <th  width="40" fname="sex">性别</th>
								  <th  width="70" fname="tell">电话</th> 
								  <th  width="100" fname="showTime">创建时间</th> 
							 </tr>
					 	 </thead>
						  <tbody id="sys_teacher_table">
							 
						  </tbody>
						</table> 
						<ul class="pagination" id="teacher_pagination">
						  
						</ul> 		
				</div>
			</div>
			<!-- 老师区域结束 -->
 </div>
 <script>
 (function(){ 
	//改变头像 和性别，还有类型
		function changeUserImage(){  
			var allstate =$("div[name='sys_teacher_table_sex_tr_td']");
			for(var i=0;i<allstate.length;i++){
				var bc = $(allstate[i]);
				if(bc.text()==1){
					bc.html('<font color="green">男</font>');
				}else if(bc.text()==0){
					bc.html('<font color="red">女</font>');
				}
			}
			 
		}
	 //查询学生的基本信息
	 function getStudentInfo(){
		var table_id ="${param.table_id}";
		
		//查询老师 
		if(table_id!=""){
			loadTeacher(null,{table_id:table_id});
		}
		function loadTeacher(event,data){
			if(typeof(data)=="undefined"){
				data={};
			}
			var url ="${pageContext.request.contextPath}/edu/sysUserAction.do?method=getStudentInfo";
			var cp =$("#teacher_pagination").find(".active");
			data.start=1;
			if(cp.length>0){
				var ccp=$(cp[0]).text();
				if(parseInt(ccp)){
					data.start=ccp;
				}
			}  
			$("#table_teacher").wgrid({
						table_title:"sys_teacher_table_title",
						tbodyId:"sys_teacher_table",
						pagination:"teacher_pagination",
						url:url,
						//checkbox:true,
						data:data,
						success:function(){
							changeUserImage();
						}
			});
		};
	 };
	 //查询用户的基本信息
	 function getStudentBaicInfo(){
		 var url ="${pageContext.request.contextPath}/edu/sysUserAction.do?method=getStudentBaicInfo";
		 $.ajax({
			   type: "POST",
			   url: url,
			   data: {table_id:"${param.table_id}"},
			   dataType:'json',
			   success: function(msg){
					for(var a in msg){
						if($("#"+a).length>0){
							if(a=="userImage"){
								$("#"+a).html("<img  src ='"+msg[a]+"' width='100' height='100'/>");
								continue;
							}
							$("#"+a).text(msg[a]);
						}
					}
				
			   }
			});
	 }
	 $(function(){
		 getStudentInfo();
		 getStudentBaicInfo();
	 });
	 window.studentInfo={};
	 window.studentInfo.getStudentInfo=getStudentInfo;
 })();
 </script>